function subEditPwdForm(){
	var form = $("#editPwdForm");
	if (ValidEditPwdForm(form)) {
		$.post("EditAdminPwd", form.serialize(), function(text) {
			var data = (new Function("return "+text))();
			alert(data.status);
			if(data.status=='密码修改成功') $("#editPassWindow").window("close"); 
		});
	}
}
function ValidEditPwdForm(form) {
	var password = $(form).find("input[name='password']");
	var password1 = $(form).find("input[name='password1']");
	var password2 = $(form).find("input[name='password2']");
	if($(password).val()==""){
		$(password).focus();
		alert("请输入原密码！");
		return false;
	}
	if($(password1).val()==""){
		$(password1).focus();
		alert("请输入新密码！");
		return false;
	}
	if($(password2).val()==""){
		$(password2).focus();
		alert("请输入确认密码！");
		return false;
	}
	if($(password1).val()!=$(password2).val()){
		$(password2).focus();
		alert("请新密码与确认密码不一致！");
		return false;
	}
	return true;
}
//重置
function resetEditPwdForm(){
	var form = $("#editPwdForm");
	var name = $(form).find("input[name='name']").val();
	var type = $(form).find("input[name='type']").val();
	form.form("clear");
	$(form).find("input[name='name']").val(name);
	$(form).find("input[name='type']").val(type);
}